Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge #5

Merged
merged 29 commits into from
Jan 27, 2021
Merged

merge #5

merged 29 commits into from
Jan 27, 2021

Conversation

DrewZhang13
Copy link
Owner


Enter [N/A] in the box, if an item is not applicable to your change.

Testing
Before we can approve your change; please submit the following in a comment:

  • Example configuration file for the change
  • Debug log output from testing the change
  • Attached Valgrind output that shows no leaks or memory corruption was found

Documentation

  • Documentation required for this feature

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

edsiper and others added 29 commits January 24, 2021 23:07
The following patch adds 'record accessor' support for the
'logstash_prefix_key' configuration property. This enable to have
custom indices based on nested fields if required, e.g;

 {"key1": 1234, "kubernetes": {"labels: {"app": "prod"}}}

You can configure a logstash prefix as follows:

 [OUTPUT]
     name                 es
     match                *
     logstash_format      on
     logstash_prefix_key  $kubernetes['labels']['app']

The final index for the record above and the proposed config will generate:

 prod-2021.01.24

Signed-off-by: Eduardo Silva <[email protected]>
Signed-off-by: Eduardo Silva <[email protected]>
The test computes the number of seconds since the dataset was
originally created, and uses the result to adjust the expected
result. But it fails to take leap years into calculation.

Teach it about leap years, and hence let `flb-it-parser` pass.

Signed-off-by: Fujimoto Seiji <[email protected]>
DB may have two or more records with the same inode values. The
problem is that when restarting, if a resumed file has same inode of a
DB record whose file is already deleted, in_tail uses the offset for
deleted file. This leads to unexpected behavior.

We can ensure that when DB contains two records with the same inode
value, the one with the smaller id can be ignored because file system
cannot have two files with the same inode if we can ignores hard
links. Thus, it is safe to query a record with the largest id.

Signed-off-by: Lee Byeoksan <[email protected]>
Monkey HTTP server is not ported to Windows yet. For this reason,
turning on the build flag causes build failure on AppVeyor.

Disable FLB_HTTP_SERVER flag so that AppVeyor runs green.
 Do not try to include <ptheads.h> on Windows

Signed-off-by: Fujimoto Seiji <[email protected]>
@DrewZhang13 DrewZhang13 merged commit f25180f into DrewZhang13:master Jan 27, 2021
DrewZhang13 pushed a commit that referenced this pull request May 3, 2021
…3055)

When libco starts, it might enter in a race condition if multiple
threads are trying to initialize the 'co_swap' function, this check
is done on every coroutine creation:

  ==346246== Possible data race during read of size 8 at 0x5CA890 by thread #5
  ==346246== Locks held: none
  ==346246==    at 0x48EFAE: co_create (amd64.c:132)
  ==346246==    by 0x173035: flb_output_coro_create (flb_output.h:511)
  ==346246==    by 0x173035: output_thread (flb_output_thread.c:281)
  ==346246==    by 0x1889BE: step_callback (flb_worker.c:44)
  ==346246==    by 0x4843B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so)
  ==346246==    by 0x487E58F: start_thread (pthread_create.c:463)
  ==346246==    by 0x4F47222: clone (clone.S:95)
  ==346246==
  ==346246== This conflicts with a previous write of size 8 by thread #4
  ==346246== Locks held: none
  ==346246==    at 0x48EFCB: co_create (amd64.c:134)
  ==346246==    by 0x173035: flb_output_coro_create (flb_output.h:511)
  ==346246==    by 0x173035: output_thread (flb_output_thread.c:281)
  ==346246==    by 0x1889BE: step_callback (flb_worker.c:44)
  ==346246==    by 0x4843B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so)
  ==346246==    by 0x487E58F: start_thread (pthread_create.c:463)
  ==346246==    by 0x4F47222: clone (clone.S:95)
  ==346246==  Address 0x5ca890 is 0 bytes inside data symbol "co_swap"

This patch introduce a new API for flb_coro interface that aims to
be called inside every worker thread. The access to this first
initialization is protected.

No more race conditions on that piece of code has been seen with valgrind
after the usage of this new function (next patches).

Signed-off-by: Eduardo Silva <[email protected]>
DrewZhang13 pushed a commit that referenced this pull request May 3, 2021
…3055)

When libco starts, it might enter in a race condition if multiple
threads are trying to initialize the 'co_swap' function, this check
is done on every coroutine creation:

  ==346246== Possible data race during read of size 8 at 0x5CA890 by thread #5
  ==346246== Locks held: none
  ==346246==    at 0x48EFAE: co_create (amd64.c:132)
  ==346246==    by 0x173035: flb_output_coro_create (flb_output.h:511)
  ==346246==    by 0x173035: output_thread (flb_output_thread.c:281)
  ==346246==    by 0x1889BE: step_callback (flb_worker.c:44)
  ==346246==    by 0x4843B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so)
  ==346246==    by 0x487E58F: start_thread (pthread_create.c:463)
  ==346246==    by 0x4F47222: clone (clone.S:95)
  ==346246==
  ==346246== This conflicts with a previous write of size 8 by thread #4
  ==346246== Locks held: none
  ==346246==    at 0x48EFCB: co_create (amd64.c:134)
  ==346246==    by 0x173035: flb_output_coro_create (flb_output.h:511)
  ==346246==    by 0x173035: output_thread (flb_output_thread.c:281)
  ==346246==    by 0x1889BE: step_callback (flb_worker.c:44)
  ==346246==    by 0x4843B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so)
  ==346246==    by 0x487E58F: start_thread (pthread_create.c:463)
  ==346246==    by 0x4F47222: clone (clone.S:95)
  ==346246==  Address 0x5ca890 is 0 bytes inside data symbol "co_swap"

This patch introduce a new API for flb_coro interface that aims to
be called inside every worker thread. The access to this first
initialization is protected.

No more race conditions on that piece of code has been seen with valgrind
after the usage of this new function (next patches).

Signed-off-by: Eduardo Silva <[email protected]>
DrewZhang13 pushed a commit that referenced this pull request May 3, 2021
…3055)

When libco starts, it might enter in a race condition if multiple
threads are trying to initialize the 'co_swap' function, this check
is done on every coroutine creation:

  ==346246== Possible data race during read of size 8 at 0x5CA890 by thread #5
  ==346246== Locks held: none
  ==346246==    at 0x48EFAE: co_create (amd64.c:132)
  ==346246==    by 0x173035: flb_output_coro_create (flb_output.h:511)
  ==346246==    by 0x173035: output_thread (flb_output_thread.c:281)
  ==346246==    by 0x1889BE: step_callback (flb_worker.c:44)
  ==346246==    by 0x4843B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so)
  ==346246==    by 0x487E58F: start_thread (pthread_create.c:463)
  ==346246==    by 0x4F47222: clone (clone.S:95)
  ==346246==
  ==346246== This conflicts with a previous write of size 8 by thread #4
  ==346246== Locks held: none
  ==346246==    at 0x48EFCB: co_create (amd64.c:134)
  ==346246==    by 0x173035: flb_output_coro_create (flb_output.h:511)
  ==346246==    by 0x173035: output_thread (flb_output_thread.c:281)
  ==346246==    by 0x1889BE: step_callback (flb_worker.c:44)
  ==346246==    by 0x4843B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so)
  ==346246==    by 0x487E58F: start_thread (pthread_create.c:463)
  ==346246==    by 0x4F47222: clone (clone.S:95)
  ==346246==  Address 0x5ca890 is 0 bytes inside data symbol "co_swap"

This patch introduce a new API for flb_coro interface that aims to
be called inside every worker thread. The access to this first
initialization is protected.

No more race conditions on that piece of code has been seen with valgrind
after the usage of this new function (next patches).

Signed-off-by: Eduardo Silva <[email protected]>
DrewZhang13 pushed a commit that referenced this pull request Sep 27, 2021
…3055)

When libco starts, it might enter in a race condition if multiple
threads are trying to initialize the 'co_swap' function, this check
is done on every coroutine creation:

  ==346246== Possible data race during read of size 8 at 0x5CA890 by thread #5
  ==346246== Locks held: none
  ==346246==    at 0x48EFAE: co_create (amd64.c:132)
  ==346246==    by 0x173035: flb_output_coro_create (flb_output.h:511)
  ==346246==    by 0x173035: output_thread (flb_output_thread.c:281)
  ==346246==    by 0x1889BE: step_callback (flb_worker.c:44)
  ==346246==    by 0x4843B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so)
  ==346246==    by 0x487E58F: start_thread (pthread_create.c:463)
  ==346246==    by 0x4F47222: clone (clone.S:95)
  ==346246==
  ==346246== This conflicts with a previous write of size 8 by thread #4
  ==346246== Locks held: none
  ==346246==    at 0x48EFCB: co_create (amd64.c:134)
  ==346246==    by 0x173035: flb_output_coro_create (flb_output.h:511)
  ==346246==    by 0x173035: output_thread (flb_output_thread.c:281)
  ==346246==    by 0x1889BE: step_callback (flb_worker.c:44)
  ==346246==    by 0x4843B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so)
  ==346246==    by 0x487E58F: start_thread (pthread_create.c:463)
  ==346246==    by 0x4F47222: clone (clone.S:95)
  ==346246==  Address 0x5ca890 is 0 bytes inside data symbol "co_swap"

This patch introduce a new API for flb_coro interface that aims to
be called inside every worker thread. The access to this first
initialization is protected.

No more race conditions on that piece of code has been seen with valgrind
after the usage of this new function (next patches).

Signed-off-by: Eduardo Silva <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants